#include <IO.h>

void dputch(char c) {
	outb(0xE9, c);
}

void dputs(const char *str) {
	while (*str) {
		dputch(*str);
		str++;
	}
}

void dputdec(unsigned int n) {
	char buf[11];
	int count = 0;
	
	if (n == 0) {
		dputch('0');
		return;
	}
	
	while (n) {
		buf[count] = n % 10;
		n /= 10;
		count++;
	}
	
	count--;
	
	while (count) {
		dputch(buf[count] + 0x30);
		count--;
	}

	dputch(buf[0] + 0x30);
}

void dputdec(int n) {
	if (n == 0) {
		dputch('0');
		return;
	}
	
	if (n < 0) {
		dputch('-');
		n = -n;
	}
	
	dputdec((unsigned) n);
}

